﻿<h3>Foursquare.GetFriends() Method</h3>

<pre class="code">
@@{
    var userFriends = Foursquare.GetFriends(accessToken, userId: 13442);
    var grid = new WebGrid(userFriends);
}    
@@grid.GetHtml(...)
</pre>

@if (Session["accessToken"] != null) {
    <h4>Friends:</h4>
    
    var userFriends = Foursquare.GetFriends(Session["accessToken"].ToString(), userId: 13442);
    var grid = new WebGrid(userFriends);

    @grid.GetHtml(tableStyle : "dg_table", headerStyle: "dg_header",
              columns: grid.Columns(
                        grid.Column(format: @<text><img src="@item.photo"/></text>, style:"imageColumn"),
                        grid.Column(columnName: "id", header: "User id", style: "highlightColumn"),
                        grid.Column(columnName: "firstName", header: "First Name"),
                        grid.Column(columnName: "lastName", header: "Last Name"),
                        grid.Column(columnName: "gender", header: "Gender"),
						grid.Column(columnName: "homeCity", header: "City")
                        )
			 )
} else {    
    <div class="message info">
        You're not logged in with Foursquare, login by clicking the following @Foursquare.GetLoginLink("link", "~/GetFriends")
    </div>
}